package TestCTR;

import java.util.ArrayList;
import org.junit.Test;
import CTRLayer.TrainerCTR;
import ModelLayer.Trainer;

public class TestTrainerCTR
{
	private TrainerCTR trc = new TrainerCTR();
	private Trainer tr = new Trainer();

	@Test
	public void testGetAllTrainers()
	{
		ArrayList<Trainer> trlist = trc.findAllTrainers();
		System.out.println("\nTest af GetAllTrainers");
		System.out.println("\nTrainer size : " + trlist.size() + "\n");
		
	    int id = 0;
		while(id <= trlist.size())
		{ /* PersonID, FirstName, LastName, Address, PostalCode, City, PhoneNr, MobileNr, Email, TrainerID, CPR, Initials, GrownupID */
			System.out.println("TrainerID    : " + trlist.get(id).getTrainerID());
			System.out.println("PersonID     : " + trlist.get(id).getPersonID());
			System.out.println("GrownupID    : " + trlist.get(id).getGrownupID());
			System.out.println("Navn         : " + trlist.get(id).getfName() + " " + trlist.get(id).getlName());
			System.out.println("Adresse      : " + trlist.get(id).getAddress());
			System.out.println("Adresse      : " + trlist.get(id).getPostalCode() + " " + trlist.get(id).getCity());
			System.out.println("Telefon      : " + trlist.get(id).getPhoneNr());
			System.out.println("Mobil        : " + trlist.get(id).getMobileNr());
			System.out.println("Email        : " + trlist.get(id).getEmail());
			System.out.println("CPR          : " + trlist.get(id).getCPR());
			System.out.println("Initials     : " + trlist.get(id).getInitials());
			System.out.println("------------------------------------");
			id++;
		};
	}

	@Test
	public void testSearchTrainerID() {
		int id = 1;
		tr = trc.findTrainerID(id);
		System.out.println("\nTest af SearchTrainerID");
		System.out.println("TrainerID    : " + tr.getTrainerID());
		System.out.println("PersonID     : " + tr.getPersonID());
		System.out.println("GrownupID    : " + tr.getGrownupID());
		System.out.println("Navn         : " + tr.getfName() + " " + tr.getlName());
		System.out.println("Adresse      : " + tr.getAddress());
		System.out.println("Adresse      : " + tr.getPostalCode() + " " + tr.getCity());
		System.out.println("Telefon      : " + tr.getPhoneNr());
		System.out.println("Mobil        : " + tr.getMobileNr());
		System.out.println("Email        : " + tr.getEmail());
		System.out.println("CPR          : " + tr.getCPR());
		System.out.println("Initials     : " + tr.getInitials());
		System.out.println("------------------------------------");
	}

}

